<template>
  <MyUnreadWorkItem :appCode="appCode" @openForm="openForm"/>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

import { State } from 'vuex-class';

import flowCenter from '@cloudpivot/flow-center/mobile';

@Component({
  name: 'circulates',
  components: {
    MyUnreadWorkItem: flowCenter.components.MyUnReadWorkItem
  }
})
export default class Circulates extends Vue {
  @State('appCode') appCode!: any;

  openForm(workitem:any) {
      //add by sunbo
    if(workitem.jumpUrl !=""){
      var url=workitem.jumpUrl;
      url =url+"&jumpUrlType=yunshu&IsMobile=True&sourceUrl=/tab/home&loginfrom=null&T=yunshu#/form/detail"; 
      
      window.open(url,'_blank');
        //newWindow.location.href = url+"&IsMobile=True&sourceUrl=/tab/home&loginfrom=null&T=yunshu#/form/detail"; //跳转到第三方代办，Url全路径
      }else{
            this.$router.push({
            name: 'form-detail',
            query: {
              workitemId: workitem.id,
              workflowInstanceId: workitem.instanceId,
              return: this.$route.fullPath,
              workitemType: 'unreadWorkitem'
            }
          }).catch((err: any) => {err});
      }
  }
}
</script>
<style lang="less" scoped>
</style>
